
J.xl = J.P.extend({
    o: function(a) {
        this.ib = 256;
        this.G = a
    },
    EK: function() {},
    DF: function(a, b) {
        b = b.split("&");
        a.face = J.e.Lh(b[this.Cx]);
        b[this.Vq] ? (a.border = J.e.Lh(b[this.Vq]), a.width = (this.G.la + 1) * (parseInt(b[this.zx]) || 1)) : a.border = null
    },
    hJ: function() {
        var a = J.style.mc;
        return a.RD.apply(a, arguments)
    },
    Yo: function(a, b, c) {
        var d = [],
            f = 0,
            g,
            h = 0,
            k;
        if (c) for (f = this.ib * b.x, h = this.ib * b.y, k = b.N, g = 0; g < a.length; g += 2) b = (f + a[g]) * k,
            c = (h + a[g + 1]) * k,
            d.push([b, c]),
            f += a[g],
            h += a[g + 1];
        else for (k = (18 < b.wc ? Math.pow(2, 18 - b.wc) : 1) / (this.G.la + 1), g = 0; g < a.length; g += 2) d.push([a[g] / k, a[g + 1] / k]);
        return d
    },
    wC: function(a, b, c) {
        var d = 0,
            f = 0,
            g = 1;
        c && (d = this.ib * b.x, f = this.ib * b.y, g = b.N);
        return [(d + a[0]) * g, (f + a[1]) * g]
    },
    fp: function(a, b, c) {
        for (var d = [], f = 0, g = a.length; f < g; f += 1) {
            var h = this.Yo(J.e.dr(a[f]), b, c);
            h.length && (d.push(h), d.Jg = d.Jg ? d.Jg + h.Jg: h.Jg)
        }
        return d
    },
    CF: function(a, b, c) {
        var d, f;
        "roadlabel" === c.type || "poilabel" === c.type ? (f = !0, d = []) : (f = !1, d = {});
        if (!b) return d;
        a.ma.wc = a.wc;
        for (var g, h, k, l, m = 0,
                 n = b.length; m < n; m += 1) if (f) for (h = 0; h < b[m][0].length; h += 1) {
            if (l = this.Qk(a, b[m][0][h], b[m][1], c)) if (18 < a.wc) {
                var q = a.wc;
                k = a.ma;
                g = Math.pow(2, q - 18);
                var r = Math.floor(l.Dd[0] / 256 * g),
                    s = Math.floor(l.Dd[1] / 256 * g),
                    r = Math.max(0, r),
                    r = Math.min(r, g - 1),
                    s = Math.max(0, s),
                    s = Math.min(s, g - 1);
                if (q = this.G.va.get(q + "/" + (g * k.x + r) + "/" + (g * k.y + s))) q.Jc || (q.Jc = []),
                    l.Dd[0] = l.Dd[0] * g % 256,
                    l.Dd[1] = l.Dd[1] * g % 256,
                    q.Jc.push(l)
            } else a.Jc.push(l)
        } else h = b[m][this.$k],
            l = this.Qk(a, b[m], h, c),
            g = this.Kk ? b[m][this.Kk] : 1,
            k = d[g] ? d[g] : d[g] = {},
        k[h] || (k[h] = [], "road" === c.type ? (q = a.wc, g = 1, 18 < q && (g = Math.pow(2, q - 18)), this.EF(k[h], h, g)) : this.DF(k[h], h)),
            k[h].push(l);
        return d
    }
});
J.Pr = J.xl.extend({
    o: function() {
        J.Pr.Ci.o.apply(this, arguments);
        this.ok = 0;
        this.Kk = 2;
        this.$k = 1;
        this.Cx = 0;
        this.zx = 1;
        this.Vq = 2
    },
    Qk: function(a, b, c) {
        return this.fp(b[this.ok], a.ma, c.sc)
    }
});
J.Nr = J.xl.extend({
    o: function() {
        J.Nr.Ci.o.apply(this, arguments);
        this.ok = 0;
        this.$k = 1;
        this.Cx = 0;
        this.zx = 1;
        this.Vq = 2
    },
    Qk: function(a, b, c) {
        return this.fp(b[this.ok], a.ma, c.sc)
    }
});
J.Rr = J.xl.extend({
    o: function() {
        J.Rr.Ci.o.apply(this, arguments);
        this.ok = 0;
        this.$k = 1;
        this.Kk = 2;
        this.PE = "solid solid_roundcap solid_squarecap dash railway dash_crewel".split(" ")
    },
    EF: function(a, b, c) {
        var d = this.PE;
        b = b.split("&");
        var f = [],
            g = 0,
            h = 0,
            k = "butt",
            l = [],
            m = 0,
            n = 0,
            q = "butt",
            m = J.e.Lh(b[1]),
            n = (parseInt(b[0]) * c || 1) * (this.G.la + 1);
        c = b[2];
        c === d[1] ? q = "round": c === d[2] ? q = "square": 0 !== c.indexOf(d[5]) && (0 === c.indexOf(d[3]) ? l = eval("[" + c.substring(5).split(")") + "]") : 0 === c.indexOf(d[4]) && (g = m, m = "white", l = eval("[" + c.substring(8).split(")") + "]"), h = n + 1 + this.G.la, n = n - 1 - this.G.la));
        b[3] && (g = J.e.Lh(b[4]), h = parseInt(b[3]) * (this.G.la + 1) + n, b = b[5], b === d[1] ? k = "round": b === d[2] ? k = "square": 0 !== b.indexOf(d[5]) && 0 === b.indexOf(d[3]) && (f = eval("[" + b.substring(5).split(")") + "]")));
        a.Yw = m;
        a.tG = n;
        a.rG = q;
        a.sG = l;
        a.du = g;
        a.oC = h;
        a.mC = k;
        a.nC = f
    },
    Qk: function(a, b, c) {
        c = this.fp(b[this.ok], a.ma, c.sc);
        if (!a.G || b[this.Kk] > a.G) a.G = b[this.Kk],
            a.Jg = 0;
        a.Jg = Math.max(a.Jg, c.Jg);
        return c
    }
});
J.wl = J.xl.extend({
    o: function(a) {
        J.wl.Ci.o.apply(this, arguments);
        this.Wc = [];
        this.$u = J.m.lc + "://" + a.Qx + "/icons/" + (J.f.aa || J.f.la ? "b": "n");
        this.pC = J.f.aa ? 15 : 7;
        this.Xp = J.f.la ? 320 : J.f.aa ? 256 : 200
    }
});
J.Or = J.wl.extend({
    o: function() {
        J.Or.Ci.o.apply(this, arguments);
        this.Tv = 0;
        this.Cw = 1;
        this.XG = 2;
        this.$k = 1;
        this.dj = 3;
        this.cf = 0;
        this.Bx = 1;
        this.Ax = 2;
        this.Uq = 3;
        this.VG = 4
    }
});
J.Qr = J.wl.extend({
    o: function() {
        J.Qr.Ci.o.apply(this, arguments);
        this.Tv = 0;
        this.Cw = 1;
        this.Qo = 2;
        this.dj = this.$k = 3;
        this.cf = 0;
        this.Bx = 1;
        this.Ax = 2;
        this.Uq = 3
    }
});
J.L.canvas.ke = J.L.If.extend({
    o: function(a, b) {
        arguments.callee.Ja.apply(this, arguments);
        this.sc = !0;
        this.rh = [];
        var c = this;
        this.Cl = function() {
            c.eF = !0;
            c.set("display", 0)
        };
        this.Ad()
    },
    LD: function(a) {
        var b = 256 * this.ab,
            c = this.qb,
            d = a.Dd.x / b,
            f = d % 1 * 256,
            d = Math.floor(d);
        a = a.Dd.y / b;
        b = a % 1 * 256;
        a = Math.floor(a);
        var g = d - 1,
            h = d + 1,
            k = a - 1,
            l = a + 1;
        128 > f ? h = d: g = d;
        for (128 > b ? l = a: k = a; g <= h; g += 1) for (var m = k; m <= l; m += 1) {
            var n = this.va.get(c + "/" + g + "/" + m);
            if (n && n.Jc) for (var q = n.Jc.length - 1; 0 <= q; q -= 1) if (n.Jc[q].xw && n.Jc[q].FE && this.AE(n.Jc[q], f, b, g - d, m - a)) return n.Jc[q]
        }
        return null
    },
    AE: function(a, b, c, d, f) {
        d = a.Dd[0] + 256 * d;
        f = a.Dd[1] + 256 * f;
        for (var g = 0; g < a.Wc.length; g += 1) {
            var h = a.Cf[g][2],
                k = a.Cf[g][3],
                l = a.Cf[g][0],
                m = a.Cf[g][1];
            this.I.la && (h /= this.I.ze, k /= this.I.ze, l /= this.I.ze, m /= this.I.ze);
            if (b >= d + l - 1 && b <= d + l + h + 1 && c >= f + m - 1 && c <= f + m + k + 1) return ! 0
        }
        return ! 1
    },
    reloadChanged: function() {
        this.Tb = !1;
        this.va.clear();
        this.ka && this.ka.parentNode && this.ka.parentNode.removeChild(this.ka);
        this.Kh && this.Kh.parentNode && this.Kh.parentNode.removeChild(this.Kh);
        this.set("display")
    },
    re: function() {
        return [this.ka, this.Kh]
    },
    YJ: function(a) {
        for (var b = 0; b < this.rh.length; b += 1) this.rh[b].wc && !a["lv" + this.rh[b].wc] && (this.rh[b].sJ = !1, this.rh[b].width = 0, this.rh[b].height = 0, this.xJ[this.rh[b].wc] = null)
    },
    gw: function(a) {
        a.Tb || (a.status = "", a.Tb = void 0, a.ya = null, a.pc = null, a.jb && (a.jb.jb = null, a.jb = null), this.va.gl(a.key))
    },
    SE: function(a, b) {
        function c(f) {
            if (b !== k.qb) {
                for (f = 0; f < a.length; f += 1) {
                    var g = a[f];
                    k.vj(b, g, h, J.e.bind(k.gw, k));
                    18 < b && k.va.gl(g.key + "/" + b)
                }
                d.onreadystatechange = ""
            } else if (g = f.indexOf("|"), -1 == g) w += f;
            else {
                w += f.substring(0, g);
                var l = JSON.parse(w);
                if (l["x-vd-v"]) k.I.gr = l["x-vd-v"],
                    d.mE = l["h-res"];
                else {
                    var m = l[0].split("-"),
                        n = m.splice(0, 3).join("/");
                    18 < b && (n += "/" + b);
                    var r = k.va.get(n);
                    r && (k.Jx(r, h) || r.jb && k.Jx(r.jb, h) ? k.I.aH(l, r, b, m[0], d.mE) : (k.vj(b, r, h, J.e.bind(k.gw, k)), 18 < b && k.va.gl(n)))
                }
                w = "";
                c(f.substring(g + 1))
            }
        }
        if (a.length) {
            var d = new XMLHttpRequest,
                f = this.I.url,
                g = [],
                h = 1,
                k = this;
            18 < b && (h = Math.pow(2, b - 18));
            17 < b && (f = f.replace("style=22", "style=6"));
            for (var l = 0; l < a.length; l += 1) {
                var m = a[l],
                    n = m.ma;
                if (18 < b) {
                    for (var q = 0; q < h; q += 1) for (var r = 0; r < h; r += 1) {
                        var s = new J.De(new J.Ce(b, h * n.x + q, h * n.y + r));
                        this.va.yb(s.key) || (this.va.set(s.key, s), s.status = "loading")
                    }
                    this.va.set(m.key + "/" + b, m)
                } else if (this.va.set(m.key, m), m.status = "loading", 10 > b) {
                    var q = n.x,
                        r = n.y,
                        s = n.z,
                        t, u;
                    u = Math.ceil(k.xc.Tk / 2);
                    var v = Math.pow(2, s);
                    q >= v && q <= v + u ? (q -= v, t = !0) : 0 > q && q >= -u && (q += v, t = !0);
                    t && (t = s + "/" + q + "/" + r, u = k.va.get(t), u || (u = new J.De(new J.Ce(s, q, r)), this.va.set(t, u), u.status = "loading"), u.jb = m, m.jb = u)
                }
                g.push(J.e.op(n.x, n.y, n.z).join(","))
            }
            f += g.join(";");
            if (0 !== g.length) {
                var x = 0,
                    w = "";
                d.UJ = "";
                d.onreadystatechange = function() {
                    if (1 !== d.readyState) if (3 === d.readyState) c(d.responseText.substring(x)),
                        x = d.responseText.length;
                    else if (4 === d.readyState) for (var f = 0; f < a.length; f += 1) k.vj(b, a[f], h,
                        function(a) {
                            k.va.yb(a.key) && (a.status = "loaded")
                        })
                };
                d.open("GET", f, !0);
                d.send()
            }
        }
    },
    Jx: function(a, b) {
        var c = a.ma.x,
            d = a.ma.y;
        return c > Math.floor(this.xc.Cd / b) || c < Math.floor(this.xc.Nd / b) || d > Math.floor(this.xc.Zc / b) || d < Math.floor(this.xc.Lc / b) ? !1 : !0
    },
    vj: function(a, b, c, d) {
        if (18 < a) {
            b = b.ma;
            for (var f = 0; f < c; f += 1) for (var g = 0; g < c; g += 1) {
                var h = new J.Ce(a, c * b.x + f, c * b.y + g) + ""; (h = this.va.get(h)) && d(h)
            }
        } else d(b),
        b.jb && d(b.jb)
    },
    dE: function(a) {
        var b = a.x,
            c = a.y;
        a = this.yc.Ve(a.z);
        return [256 * a * b, 256 * a * c, 256 * a * (b + 1), 256 * a * (c + 1)]
    }
});
J.L.canvas.ke.nc = J.P.extend({
    o: function(a, b) {
        this.kb = a;
        this.Wc = {};
        this.uh = b
    },
    Sw: function(a) {
        var b = [],
            c;
        for (c in a) a.hasOwnProperty(c) && (a[c].ml = parseInt(c), b.push(a[c]));
        b.sort(function(a, b) {
            return a.ml > b.ml ? 1 : -1
        });
        for (c in b) if (b.hasOwnProperty(c)) {
            a = b[c];
            for (var d in a) if (a.hasOwnProperty(d)) {
                var f = a[d];
                this.Dq(f, f.face, f.border, f.width)
            }
        }
    },
    Dq: function(a, b, c, d) {
        var f = this.kb.getContext("2d"),
            g,
            h,
            k,
            l,
            m,
            n,
            q,
            r = [NaN, NaN, 0],
            s = [NaN, NaN];
        f.save();
        c && d && (f.strokeStyle = c, f.lineWidth = d);
        b && (f.fillStyle = b);
        this.zj = {};
        f.beginPath();
        g = 0;
        for (h = a.length; g < h; g += 1) if (k = a[g], l = k.length, 0 < l) for (var t = 0; t < l; t += 1) {
            var u;
            m = k[t];
            n = 0;
            for (q = m.length; n < q; n += 1) if (r = m[n], 0 === n) u = s = r,
                f.moveTo(r[0], r[1]);
            else if (r[0] !== s[0] || r[1] !== s[1]) f.lineTo(r[0], r[1]),
                s = r;
            f.lineTo(u[0], u[1])
        }
        b && f.fill();
        c && d && f.stroke();
        f.restore();
        return ! 0
    },
    aj: function(a) {
        if ("IMG" === a.tagName || "CANVAS" === a.tagName) return a;
        var b = this.Wc[a];
        if ("undefined" === typeof b) return b = document.createElement("img"),
            b.src = a,
            this.Wc[a] = b,
            b.loaded = !1,
            J.h.Yg(b, "load", this.Mp, this),
            null;
        if (b.loaded) return b
    },
    Mp: function(a) {
        a.target.loaded = !0;
        this.uh && this.uh()
    },
    ob: function(a, b) {
        return this.gf ? [(a - this.eh[0]) / this.ab, (b - this.eh[1]) / this.ab] : [0.5 + (a - this.eh[0]) / this.ab << 0, 0.5 + (b - this.eh[1]) / this.ab << 0]
    },
    nG: function(a) {
        var b = [],
            c;
        for (c in a) a.hasOwnProperty(c) && (a[c].ml = parseInt(c), b.push(a[c]));
        b.sort(function(a, b) {
            return a.ml > b.ml ? 1 : -1
        });
        for (c in b) if (b.hasOwnProperty(c)) {
            a = b[c];
            var d, f;
            for (d in a) a.hasOwnProperty(d) && (f = a[d], f.du && this.Tw(f, f.du, f.oC, f.mC, f.nC));
            for (d in a) a.hasOwnProperty(d) && (f = a[d], f.Yw && this.Tw(f, f.Yw, f.tG, f.rG, f.sG))
        }
    },
    Tw: function(a, b, c, d, f) {
        var g = this.kb.getContext("2d");
        g.save();
        g.lineWidth = c;
        g.strokeStyle = b;
        g.lineCap = d;
        g.lineJoin = "bevel";
        g.setLineDash ? (this.Ui(g, a), f && g.setLineDash(f)) : f && 1 < f.length ? this.dm(g, a, f) : this.Ui(g, a);
        g.stroke();
        g.restore();
        return ! 0
    },
    Ui: function(a, b) {
        a.beginPath();
        var c, d, f, g, h, k, l, m, n, q;
        c = 0;
        for (h = b.length; c < h; c += 1) for (k = b[c], d = 0, l = k.length; d < l; d += 1) for (n = k[d], f = 0, m = n.length; f < m; f += 1) if (g = n[f], 0 === f) a.moveTo(g[0], g[1]),
            q = g;
        else if (g[0] !== q[0] || g[1] !== q[1]) a.lineTo(g[0], g[1]),
            q = g
    },
    dm: function(a, b, c) {
        a.beginPath();
        var d, f, g, h, k, l, m, n, q, r;
        d = 0;
        for (k = b.length; d < k; d += 1) for (l = b[d], a.gp = 0, a.Ym = !1, f = 0, m = l.length; f < m; f += 1) for (q = l[f], g = 0, n = q.length; g < n; g += 1) if (h = q[g], 0 === g) a.moveTo(h[0], h[1]),
            r = h;
        else if (h[0] !== r[0] || h[1] !== r[1]) a.hp(r[0], r[1], h[0], h[1], c),
            r = h;
        a.closePath()
    },
    Qw: function(a, b, c, d, f, g, h, k, l) {
        var m = this.kb.getContext("2d");
        m.setLineDash ? (this.Ui(m, a), g && (m.save(), l && m.setLineDash(l), m.lineWidth = h, m.strokeStyle = g, m.lineCap = k, m.lineJoin = "bevel", m.stroke(), m.restore()), m.save(), f && m.setLineDash(f), m.lineWidth = c, m.strokeStyle = b, m.lineCap = d) : (d = l && 1 < l.length, k = f && 1 < f.length, h && (m.save(), d ? this.dm(m, a, l) : this.Ui(m, a), m.lineWidth = h, m.strokeStyle = g, m.lineJoin = "bevel", m.stroke(), m.restore(), m.save()), d ? k ? f.join(",") !== l.join(",") && this.dm(m, a, f) : this.Ui(m, a) : k ? this.dm(m, a, f) : h || this.Ui(m, a), m.lineWidth = c, m.strokeStyle = b);
        m.lineJoin = "bevel";
        m.stroke();
        m.restore();
        return ! 0
    }
});
J.G.ke = J.G.he.extend({
    o: function(a, b) {
        this.ze = 2;
        this.Hx = a.get("textRatio") || 2;
        this.gy = J.f.Gd ? 60 : 30;
        this.D("tiles", a);
        this.Qx = a.get("vdataUrl") || "vdata.amap.com";
        this.sc = !0;
        this.$b = a;
        this.jf = !1;
        this.l = b;
        this.mf = this.lf = !0;
        this.Hc("zoom center crs centerCoords resolution coordsBound display".split(" "), b);
        this.Hc("zooms detectRetina visible zIndex textIndex watermark opacity".split(" "), a);
        this.D("lang", b, !0);
        this.get("watermark") && (this.ll = new Image, this.ll.src = this.get("watermark"));
        this.va = {};
        this.Jd = {};
        this.ib = 256;
        this.fi = [];
        this.Af = this.Bf = 0;
        this.uG = {
            road: 0,
            region: 0,
            building: 1,
            poilabel: 1,
            roadlabel: 1
        };
        this.cn = [new J.ed, new J.ed, new J.ed, new J.ed, new J.ed];
        this.ef = [{
            type: "region",
            show: !0,
            lj: new J.Pr(this),
            sc: 0
        },
            {
                type: "road",
                show: !0,
                lj: new J.Rr(this),
                sc: 0
            },
            {
                type: "building",
                show: !0,
                lj: new J.Nr(this),
                sc: 0
            },
            {
                type: "roadlabel",
                show: !0,
                lj: new J.Qr(this),
                sc: 1
            },
            {
                type: "poilabel",
                show: !0,
                lj: new J.Or(this),
                sc: 1
            }];
        this.Rg = 0;
        this.kb = document.createElement("canvas");
        this.Jt = document.createElement("canvas");
        this.Jt.height = this.Jt.width = 256;
        this.D("features", b);
        this.D("mapStyle", b);
        this.Zi = this.get("crs");
        this.lb = new J.L.canvas.ke.nc
    },
    featuresChanged: function() {
        for (var a = 0; a < this.ef.length; a += 1) this.ef[a].show = !1;
        var b = this.get("features");
        if ("all" === b) for (a = 0; a < this.ef.length; a += 1) this.ef[a].show = !0;
        else if (b) for (a = 0; a < b.length; a += 1)"bg" === b[a] && (this.ef[0].show = !0),
        "road" === b[a] && (this.ef[1].show = !0, this.ef[3].show = !0),
        "building" === b[a] && (this.ef[2].show = !0),
        "point" === b[a] && (this.ef[4].show = !0);
        this.set("reload")
    },
    mapStyleChanged: function() {
        var a = this.get("mapStyle");
        this.Uy = "dark" === a ? "#202020": "test" === a || "blue_night" === a ? "#033447": "#fcf9f2";
        this.url = J.m.lc + "://" + this.Qx + "/tiles?mapType=" + a + "&v=2&style=" + (J.f.aa ? J.f.la && this.get("detectRetina") ? "5": "6": "5") + "&t=";
        this.set("reload")
    },
    langChanged: function() {
        this.set("reload");
        this.$b.Gw()
    },
    hn: function(a, b) {
        "hotspotout" === a ? this.l.Sb.set("optimalCursor", null) : "hotspotover" === a && this.l.Sb.set("optimalCursor", "pointer");
        var c = b.Pa,
            c = new J.C(c[0], c[1]),
            c = this.l.qe(c, 3);
        this.l.Sb.k(a, {
            name: b.name,
            lnglat: c,
            id: b.xw
        })
    },
    Eg: function(a) { (a = this.fv(a)) && this.hn("hotspotclick", a)
    },
    Ke: function(a) { (a = this.fv(a)) && this.Ge !== a && (this.Ge && this.hn("hotspotout", this.Ge), this.hn("hotspotover", a)); ! a && this.Ge && this.hn("hotspotout", this.Ge);
        this.Ge = a
    },
    textIndexChanged: function() {
        this.set("display")
    },
    vF: function() {
        this.l.c("click", this.Eg, this);
        this.l.c("mousemove", this.Ke, this)
    },
    zu: function() {
        this.l.A("click", this.Eg, this);
        this.l.A("mousemove", this.Ke, this)
    },
    fv: function(a) {
        return this.l.Cm.xk(this).LD(a)
    },
    aH: function(a, b, c, d) {
        if (b.Tb && b.jb) b.jb.Tb || (b.jb.pc = b.pc, b.jb.ya = b.jb.Ig = b.jb.Tb = !0);
        else {
            b.Jc || (b.Jc = []);
            b.Fd || (b.Fd = {},
                b.wc = c, b.ma.N = this.Zi.Ve(b.ma.z));
            var f;
            switch (d) {
                case "region":
                    f = 0;
                    break;
                case "road":
                    f = 1;
                    break;
                case "building":
                    f = 2;
                    break;
                case "roadlabel":
                    f = 3;
                    break;
                case "poilabel":
                    f = 4
            }
            if (0 === f || 4 === f || 1 !== a.length) this.cn[f].cr(["co", f, b]),
            this.ef[f].show && this.cn[f].cr([a.splice(1), f, b]),
            this.Rg > f && (this.Rg = f);
            3 === f && (this.cn[3].cr(["co", 5, b]), 2 < this.Rg && (this.Rg = 2));
            this.tx()
        }
    },
    tx: function() {
        this.tw || (this.tw = J.e.ni(function() {
                var a = new Date,
                    b = !1;
                do
                    if (b = this.parse(), new Date - a >= this.gy) break;
                while (!b);
                this.tw = null;
                b || this.tx()
            },
            this))
    },
    ZC: function() {
        return document.createElement("canvas")
    },
    parse: function() {
        var a, b = !1,
            c = this.Rg,
            d = this.cn[this.Rg];
        if (!d.ej()) {
            a = d.fF();
            if (!a) return b;
            var f = a[2],
                g = f.wc,
                h,
                k = f.key + (18 < g ? "/" + g: "");
            if (!this.va.yb(k)) return b;
            if ("co" === a[0]) if (0 === a[1]) this.wq(f),
            f.Fd.region && "v4" !== this.gr || (g = this.lb.kb.getContext("2d"), g.fillStyle = this.Uy, g.fillRect(0, 0, f.pc.width, f.pc.height)),
            f.Fd.region && (this.lb.Sw(f.Fd.region, 0, f.ma.z), f.Fd.region = null),
                f.ya = !0,
            f.jb && (f.jb.ya = !0);
            else if (2 === a[1] && f.Fd && f.Fd.building) this.wq(f),
                this.lb.Sw(f.Fd.building, 1, f.ma.z),
                f.Fd.building = null;
            else if (1 === a[1]) this.wq(f),
            f.Fd.road && (this.lb.nG(f.Fd.road, f.ma.z), f.Fd.road = null),
                f.Ig = !0,
            f.jb && (f.jb.Ig = !0);
            else if (4 === a[1]) {
                if (18 < g) {
                    a = f.ma;
                    h = Math.pow(2, g - 18);
                    for (var l = 0; l < h; l += 1) for (var m = 0; m < h; m += 1) {
                        var n = this.va.get(g + "/" + (h * a.x + l) + "/" + (h * a.y + m));
                        n && (n.Tb = !0, n.Vv = !0)
                    }
                    this.va.gl(k)
                } else f.Tb = !0,
                    f.Vv = !0;
                f.Ig = !0;
                f.jb && (f.jb.Tb = !0, f.jb.Vv = !0, f.jb.Ig = !0)
            } else if (5 === a[1]) if (f.Fd = null, f.ya = !0, 18 < g) for (a = f.ma, k = this.ib, h = Math.pow(2, g - 18), l = 0; l < h; l += 1) for (m = 0; m < h; m += 1)(n = this.va.get(g + "/" + (h * a.x + l) + "/" + (h * a.y + m))) && !n.ya && (n.pc = this.ZC(), n.pc.width = n.pc.height = k, n.pc.getContext("2d").drawImage(f.pc, -l * k, -m * k), n.Ig = !0, n.Tb = !0, n.ya = !0, this.ll && 0 === (n.ma.x + n.ma.y) % 2 && n.pc.getContext("2d").drawImage(this.ll, 0, 0));
            else this.ll && 0 === (f.ma.x + f.ma.y) % 2 && f.pc.getContext("2d").drawImage(this.ll, 0, 0);
            else 6 === a[1] && this.set("display", 0);
            else g = this.ef[a[1]],
                g.lj.map = this.l,
                h = g.lj.CF(f, a[0], g),
            3 !== a[1] && 4 !== a[1] && (f.Fd[g.type] = h);
            d.ej() && (1 === c && 2 === c || this.l.cl || this.set("display", 0))
        }
        d.ej() && (4 === c && (b = !0, this.Tb || (this.Z("complete"), this.Tb = !0)), this.Rg = (this.Rg + 1) % 5);
        return b
    },
    wq: function(a) {
        var b = 18 < a.wc ? Math.pow(2, 18 - a.wc) : 1;
        a.pc || (a.pc = document.createElement("canvas"), a.pc.width = a.pc.height = this.ib / b, a.Ig = !1);
        this.lb.kb = a.pc;
        this.lb.ab = b
    },
    te: function() {
        return null
    },
    ag: function() {
        this.la = this.get("detectRetina") && J.f.la;
        this.ib = 256 * (this.la + 1);
        return {
            IE: !0,
            ib: 256,
            visible: this.get("visible"),
            g: this.vm(),
            Qb: this.get("zooms"),
            cm: this.jf,
            lf: !this.l.cl,
            mf: !this.l.cl,
            opacity: this.get("opacity"),
            te: this.te,
            la: !1
        }
    },
    Qg: function(a) {
        if (J.L.canvas.ke) return new J.L.canvas.ke(this, a)
    }
});